package com.technique.api.dao.mapper;

import com.technique.api.dao.entity.Place;
import com.technique.api.dao.entity.PlaceExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PlaceMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @SelectProvider(type=PlaceSqlProvider.class, method="countByExample")
    int countByExample(PlaceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @DeleteProvider(type=PlaceSqlProvider.class, method="deleteByExample")
    int deleteByExample(PlaceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @Delete({
        "delete from place",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @Insert({
        "insert into place (id, cn_name, ",
        "en_name)",
        "values (#{id,jdbcType=BIGINT}, #{cnName,jdbcType=VARCHAR}, ",
        "#{enName,jdbcType=VARCHAR})"
    })
    int insert(Place record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @InsertProvider(type=PlaceSqlProvider.class, method="insertSelective")
    int insertSelective(Place record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @SelectProvider(type=PlaceSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="cn_name", property="cnName", jdbcType=JdbcType.VARCHAR),
        @Result(column="en_name", property="enName", jdbcType=JdbcType.VARCHAR)
    })
    List<Place> selectByExample(PlaceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, cn_name, en_name",
        "from place",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="cn_name", property="cnName", jdbcType=JdbcType.VARCHAR),
        @Result(column="en_name", property="enName", jdbcType=JdbcType.VARCHAR)
    })
    Place selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @UpdateProvider(type=PlaceSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Place record, @Param("example") PlaceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @UpdateProvider(type=PlaceSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Place record, @Param("example") PlaceExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @UpdateProvider(type=PlaceSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Place record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table place
     *
     * @mbggenerated
     */
    @Update({
        "update place",
        "set cn_name = #{cnName,jdbcType=VARCHAR},",
          "en_name = #{enName,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(Place record);
}